package com.lagou.dao;

import com.lagou.pojo.AuthCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface AuthCodeDao extends JpaRepository<AuthCode, Integer>, JpaSpecificationExecutor<AuthCode> {
    /**
     * jpql
     */
    @Query("from AuthCode  where email=?1 and code=?2 and expireTime >=?3 order by id desc")
    public List<AuthCode> findByJpql(String email, String code, Date expireTime);
}
